/**********************************************************
 * OverviewAction.java
 * Created by Ankur
 * Last modified Date: Sep 17, 2008 3:57:47 PM by Ankur
 * Version : 0.1
 * Copyright (c) 2008 - 2008 cyberThink Infotech Pvt. Ltd., All rights reserved.
 **********************************************************/

package com.printeverywhere.action;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.apache.struts2.interceptor.ServletRequestAware;

import com.printeverywhere.dto.User;
import com.printeverywhere.util.AttributeConstants;

/**
 * The Class OverviewAction.
 */
public class OverviewAction extends FrontBaseSupport implements ServletRequestAware{

	/** The Constant logger. */
	private static final Logger logger = Logger.getLogger(OverviewAction.class);

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 1L;

	/** The user. */
	private User user;

	/** The request. */
	private HttpServletRequest request;

	public OverviewAction(){
		super(true, false);
		setMyAccount(true);
	}

	/* (non-Javadoc)
	 * @see com.opensymphony.xwork2.ActionSupport#execute()
	 */
	@Override
	public String execute() throws Exception {
		if (logger.isDebugEnabled()) {
			logger.debug("execute() - start");
		}
		user = (User)request.getSession().getAttribute(AttributeConstants.USER);
		if (logger.isDebugEnabled()) {
			logger.debug("execute() - end");
		}
		return SUCCESS;
	}

	/* (non-Javadoc)
	 * @see org.apache.struts2.interceptor.ServletRequestAware#setServletRequest(javax.servlet.http.HttpServletRequest)
	 */
	public void setServletRequest(HttpServletRequest arg0) {
		request = arg0;
	}

	/**
	 * Gets the user.
	 *
	 * @return the user
	 */
	public User getUser() {
		return user;
	}

	/**
	 * Sets the user.
	 *
	 * @param user the user to set
	 */
	public void setUser(User user) {
		this.user = user;
	}
}